multiselection: Don't emit nonsensical signals
authorMatthias Clasen <mclasen@redhat.com>
Sat, 6 Jun 2020 03:15:20 +0000 (23:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 6 Jun 2020 03:15:20 +0000 (23:15 -0400)
I forgot to add a check here. We only want to emit
a ::selection-changed if we actually changed it.

gtk/gtkmultiselection.c

index 31572072a74bfa9167733db154c315820d1bb048..9f2daae44afdc8d33f960bb34cddb9ed7c422d99 100644 (file)
@@ -212,7 +212,8 @@ gtk_multi_selection_add_or_remove (GtkSelectionModel    *model,
     }
   while (n > 0);
 
-  gtk_selection_model_selection_changed (model, min, max - min + 1);
+  if (min <= max)
+    gtk_selection_model_selection_changed (model, min, max - min + 1);
 
   return TRUE;
 }